home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer 2.0 / Internet Surfer 2.0 (Wayzata Technology) (1996).iso / pc / text / mac / faqs.555 < prev    next >
Text File  |  1996-02-12  |  28KB  |  597 lines

  1. Frequently Asked Questions (FAQS);faqs.555
  2.  
  3.  
  4.  
  5.     Motif++ is a public-domain library that defines C++ class wrappers for
  6. Motif 1.1; it adds an "application" class for, e.g., initializing X, and also
  7. integrates WCL and the Xbae widget set. This work was developed by Ronald van
  8. Loon <rvloon@cv.ruu.nl> based on X++, a set of bindings done by the University
  9. of Lowell Graphics Research Laboratory. The current sources are available from
  10. decuac.dec.com (192.5.214.1) as /pub/X11/motif++.21.jul.92.tar.Z.
  11.     
  12.     The source code examples for Doug Young's "Object-Oriented Programming
  13. with C++ and OSF/Motif" [ISBN 0-13-630252-1] do not include "widget wrappers"
  14. but do include a set of classes that encapsulates higher-level facilities
  15. commonly needed by Motif- or other Xt-based applications; check export in
  16. ~ftp/contrib/young.c++.tar.Z.
  17.     Rogue Wave offers "View.h++" for C++ programmers using Motif; info:
  18. 1-800-487-3217 or +1 503 754 2311.
  19.     A product called "Commonview" by Glockenspiel Ltd, Ireland (??)
  20. apparently is a C++-based toolkit for multiple window systems, including PM,
  21. Windows, and X/Motif.
  22.     Xv++ is sold by Qualix (415-572-0200; fax -1300); it implements an
  23. interface from the GIL files that Sun's OpenWindows Developers Guide 3.0
  24. produces to Xview wrapper classes in C++.
  25.  
  26.     UIT is a set of C++ classes embedding the XView toolkit; it is intended
  27. for use with Sun's OpenWindows Developers Guide 3.0 builder tool. Sources are
  28. on export.mit.edu.au as UIT.tar.Z. Version 2 was released 5/28/92.
  29.     
  30.     Also of likely use is ObjectCenter (Saber-C++). And a reasonable
  31. alternative to all of the above is ParcPlace's (formerly Solbourne's) Object
  32. Interface.
  33.  
  34. [Thanks to Douglas S. Rand (dsrand@mitre.org) and George Wu (gwu@tcs.com);2/91]
  35.  
  36. ----------------------------------------------------------------------
  37. Subject: 135)! Where can I obtain alternate language bindings to X?
  38.  
  39.     Versions of the CLX Lisp bindings are part of the X11 core source
  40. distributions. A version of CLX is on the R5 tape [10/91]; version 5.0.2 [9/92]
  41. is on export.lcs.mit.edu in /contrib/CLX.R5.02.tar.Z.
  42.  
  43.     The SAIC Ada-X11 bindings are through anonymous ftp in /pub from
  44. stars.rosslyn.unisys.com (128.126.164.2).
  45.     There is an X/Ada study team sponsored by NASA JSC, which apparently is
  46. working out bindings. Information: xada@ghg.hou.tx.us.
  47.     GNU SmallTalk has a beta native SmallTalk binding to X called STIX (by
  48. Steven.Byrne@Eng.Sun.COM). It is still in its beginning stages, and
  49. documentation is sparse outside the SmallTalk code itself. The sources are
  50. available as /pub/gnu/smalltalk-1.1.1.tar.Z on prep.ai.mit.edu (18.71.0.38) or
  51. ugle.unit.no (129.241.1.97).
  52.     Prolog bindings (called "XWIP") written by Ted Kim at UCLA while
  53. supported in part by DARPA are available by anonymous FTP from
  54. export.lcs.mit.edu:contrib/xwip.tar.Z or ftp.cs.ucla.edu:pub/xwip.tar.Z.
  55. These prolog language bindings depend on having a Quintus-type foreign function
  56. interface in your prolog. The developer has gotten it to work with Quintus and
  57. SICStus prolog. Inquiries should go to xwip@cs.ucla.edu. [3/90]
  58.     Scheme bindings to Xlib, OSF/Motif, and Xaw are part of the Elk
  59. distribution; version 1.5a on export obsoletes the version on the R5 contrib
  60. tape.
  61.     x-scm, a bolt-on accessory for Aubrey Jaffer's "scm" Scheme interpreter
  62. that provides an interface to Xlib, Motif, and OpenLook, is now available via
  63. FTP from altdorf.ai.mit.edu:archive/scm/xscm1.05.tar.Z and
  64. nexus.yorku.ca:pub/scheme/new/xscm1.05.tar.Z.
  65.  
  66.     Ada bindings to Motif, explicitly, will eventually be made available by
  67. the Jet Propulsion Laboratories, probably through the normal electronic
  68. means.  Advance information can be obtained from dsouleles@dsfvax.jpl.nasa.gov,
  69. who may respond as time permits.
  70.     AdaMotif is a complete binding to X and Motif for the Ada language, for
  71. many common systems; it is based in part upon the SAIC/Unisys bindings and also
  72. includes a UIL to Ada translator. Info: Systems Engineering Research
  73. Corporation, 1-800-Ada-SERC (well!serc@apple.com).
  74.  
  75.     Also: the MIT Consortium, although not involved in producing Ada
  76. bindings for X, maintains a partial listing of people involved in X and Ada;
  77. information is available from Donna Converse, converse@expo.lcs.mit.edu.
  78.  
  79. ----------------------------------------------------------------------
  80. Subject: 136)  Can XGetWindowAttributes get a window's background pixel/pixmap?
  81.  
  82.     No.  Once set, the background pixel or pixmap of a window cannot be
  83. re-read by clients.  The reason for this is that a client can create a pixmap,
  84. set it to be the background pixmap of a window, and then free the pixmap. The
  85. window keeps this background, but the pixmap itself is destroyed.  If you're
  86. sure a window has a background pixel (not a pixmap), you can use XClearArea()
  87. to clear a region to the background color and then use XGetImage() to read
  88. back that pixel.  However, this action alters the contents of the window, and
  89. it suffers from race conditions with exposures. [courtesy Dave Lemke of NCD
  90. and Stuart Marks of Sun]
  91.  
  92.     Note that the same applies to the border pixel/pixmap. This is a
  93. (mis)feature of the protocol which allows the server is free to manipulate the
  94. pixel/pixmap however it wants.  By not requiring the server to keep the
  95. original pixel or pixmap, some (potentially a lot of) space can be saved.
  96. [courtesy Jim Fulton, MIT X Consortium]
  97.  
  98. ----------------------------------------------------------------------
  99. Subject: 137)  How do I create a transparent window?
  100.     
  101.     A completely transparent window is easy to get -- use an InputOnly
  102. window. In order to create a window which is *mostly* transparent, you have
  103. several choices:
  104.     - the SHAPE extension first released with X11R4 offers an easy way to
  105. make non-rectangular windows, so you can set the shape of the window to fit the
  106. areas where the window should be nontransparent; however, not all servers
  107. support the extension.
  108.     - a machine-specific method of implementing transparent windows for
  109. particular servers is to use an overlay plane supported by the hardware.  Note
  110. that there is no X notion of a "transparent color index".
  111.     - a generally portable solution is to use a large number of tiny
  112. windows, but this makes operating on the application as a unit difficult.
  113.     - a final answer is to consider whether you really need a transparent
  114. window or if you would be satisfied with being able to overlay your application
  115. window with information; if so, you can draw into separate bitplanes in colors
  116. that will appear properly.
  117.  
  118. [thanks to der Mouse, mouse@lightning.McRCIM.McGill.EDU, 3/92; see also
  119. The X Journal 1:4 for a more complete answer, including code samples for this
  120. last option]
  121.  
  122. ----------------------------------------------------------------------
  123. Subject: 138)  Why doesn't GXxor produce mathematically-correct color values?
  124.  
  125.     When using GXxor you may expect that drawing with a value of black on a
  126. background of black, for example, should produce white. However, the drawing
  127. operation does not work on RGB values but on colormap indices. The color that
  128. the resulting colormap index actually points to is undefined and visually
  129. random unless you have actually filled it in yourself. [On many X servers Black
  130. and White often 0/1 or 1/0; programs taking advantage of this mathematical
  131. coincidence will break.]
  132.     If you want to be combining colors with GXxor, then you should be
  133. allocating a number of your own color cells and filling them with your chosen
  134. pre-computed values.
  135.     If you want to use GXxor simply to switch between two colors, then you
  136. can take the shortcut of setting the background color in the GC (graphics
  137. context) to 0 and the foreground color to a value such that when it draws over
  138. red, say, the result is blue, and when it draws over blue the result is red.
  139. This foreground value is itself the XOR of the colormap indices of red and
  140. blue.
  141.  
  142. [Thanks to Chris Flatters (cflatter@zia.aoc.nrao.EDU) and Ken Whaley
  143. (whaley@spectre.pa.dec.com), 2/91]
  144.  
  145. ----------------------------------------------------------------------
  146. Subject: 139)  Why does every color I allocate show up as black?
  147.  
  148.     Make sure you're using 16 bits and not 8.  The red, green, and blue
  149. fields of an XColor structure are scaled so that 0 is nothing and 65535 is
  150. full-blast. If you forget to scale (using, for example, 0-255 for each color)
  151. the XAllocColor function will perform correctly but the resulting color is
  152. usually black.
  153.  
  154. [Thanks to Paul Asente, asente@adobe.com, 7/91]
  155.  
  156. ----------------------------------------------------------------------
  157. Subject: 140)  Why can't my program get a standard colormap?
  158. I have an image-processing program which uses XGetRGBColormap() to get the
  159. standard colormap, but it doesn't work.
  160.  
  161.     XGetRGBColormap() when used with the property XA_RGB_DEFAULT_MAP does
  162. not create a standard colormap -- it just returns one if one already exists.
  163. Use xstdcmap or do what it does in order to create the standard colormap first.
  164.  
  165. [1/91; from der Mouse (mouse@larry.mcrcim.mcgill.edu)]
  166.  
  167. ----------------------------------------------------------------------
  168. Subject: 141)  Why does the pixmap I copy to the screen show up as garbage?
  169.  
  170.     The initial contents of pixmaps are undefined.  This means that most
  171. servers will allocate the memory and leave around whatever happens to be there
  172. -- which is usually garbage.  You probably want to clear the pixmap first using
  173. XFillRectangle() with a function of GXcopy and a foreground pixel of whatever
  174. color you want as your background (or 0L if you are using the pixmap as a
  175. mask). [courtesy Dave Lemke of NCD and Stuart Marks of Sun]
  176.  
  177. ----------------------------------------------------------------------
  178. Subject: 142)  How do I check whether a window ID is valid?
  179. My program has the ID of a window on a remote display. I want to check whether
  180. the window exists before doing anything with it.
  181.  
  182.     Because X is asynchronous, there isn't a guarantee that the window
  183. would still exist between the time that you got the ID and the time you sent an
  184. event to the window or otherwise manipulated it. What you should do is send the
  185. event without checking, but install an error handler to catch any BadWindow
  186. errors, which would indicate that the window no longer exists. This scheme will
  187. work except on the [rare] occasion that the original window has been destroyed
  188. and its ID reallocated to another window.
  189.  
  190. [courtesy Ken Lee (klee@wsl.dec.com), 4/90]
  191.  
  192. ----------------------------------------------------------------------
  193. Subject: 143)  Can I have two applications draw to the same window?
  194.  
  195.     Yes. The X server assigns IDs to windows and other resources (actually,
  196. the server assigns some bits, the client others), and any application that
  197. knows the ID can manipulate the resource [almost any X server resource, except
  198. for GCs and private color cells, can be shared].
  199.     The problem you face is how to disseminate the window ID to multiple
  200. applications. A simple way to handle this (and which solves the problem of the
  201. applications' running on different machines) is in the first application to
  202. create a specially-named property on the root-window and put the window ID into
  203. it. The second application then retrieves the property, whose name it also
  204. knows, and then can draw whatever it wants into the window.
  205.     [Note: this scheme works iff there is only one instance of the first
  206. application running, and the scheme is subject to the limitations mentioned
  207. in the Question about using window IDs on remote displays.]
  208.     Note also that you will still need to coordinate any higher-level
  209. cooperation among your applications.
  210.     Note also that two processes can share a window but should not try to
  211. use the same server connection. If one process is a child of the other, it
  212. should close down the connection to the server and open its own connection.
  213.  
  214. [mostly courtesy Phil Karlton (karlton@wpd.sgi.com) 6/90]
  215.  
  216. ----------------------------------------------------------------------
  217. Subject: 144)  Why can't my program work with tvtwm or swm?
  218.  
  219.     A number of applications, including xwd, xwininfo, and xsetroot, do not
  220. handle the virtual root window which tvtwm and swm use; they typically return
  221. the wrong child of root. A general solution is to add this code or to use it in
  222. your own application where you would normally use RootWindow(dpy,screen):
  223.  
  224. /* Function Name: GetVRoot
  225.  * Description: Gets the root window, even if it's a virtual root
  226.  * Arguments: the display and the screen
  227.  * Returns: the root window for the client
  228.  */
  229. #include <X11/Xatom.h>
  230. Window GetVRoot(dpy, scr)
  231. Display        *dpy;
  232. int             scr;
  233. {
  234. Window          rootReturn, parentReturn, *children;
  235. unsigned int    numChildren;
  236. Window          root = RootWindow(dpy, scr);
  237. Atom            __SWM_VROOT = None;
  238. int             i;
  239.  
  240.   __SWM_VROOT = XInternAtom(dpy, "__SWM_VROOT", False);
  241.   XQueryTree(dpy, root, &rootReturn, &parentReturn, &children, &numChildren);
  242.   for (i = 0; i < numChildren; i++) {
  243.     Atom            actual_type;
  244.     int             actual_format;
  245.     long            nitems, bytesafter;
  246.     Window         *newRoot = NULL;
  247.  
  248.     if (XGetWindowProperty(dpy, children[i], __SWM_VROOT, 0, 1,
  249.         False, XA_WINDOW, &actual_type, &actual_format, &nitems,
  250.             &bytesafter, (unsigned char **) &newRoot) == Success && newRoot) {
  251.             root = *newRoot;
  252.             break;
  253.         }
  254.     }
  255.  
  256.     return root;
  257. }
  258.  
  259. [courtesy David Elliott (dce@smsc.sony.com). Similar code is in ssetroot, a
  260. version of xsetroot distributed with tvtwm. 2/91]
  261.  
  262. A header file by Andreas Stolcke of ICSI on export.lcs.mit.edu:contrib/vroot.h
  263. functions similarly by providing macros for RootWindow and DefaultRootWindow;
  264. code can include this header file first to run properly in the presence of a
  265. virtual desktop.
  266.     
  267. ----------------------------------------------------------------------
  268. Subject: 145)  How do I keep a window from being resized by the user?
  269.  
  270.     Resizing the window is done through the window manager; window managers
  271. can pay attention to the size hints your application places on the window, but
  272. there is no guarantee that the window manager will listen. You can try setting
  273. the minimum and maximum size hints to your target size and hope for the best.
  274. [1/91]
  275.  
  276. ----------------------------------------------------------------------
  277. Subject: 146)  How do I keep a window in the foreground at all times?
  278.  
  279.     It's rather antisocial for an application to constantly raise itself
  280. [e.g. by tracking VisibilityNotify events] so that it isn't overlapped --
  281. imagine the conflict between two such programs running.
  282.     The only sure way to have your window appear on the top of the stack
  283. is to make the window override-redirect; this means that you are temporarily
  284. assuming window-management duties while the window is up, so you want to do
  285. this infrequently and then only for short periods of time (e.g. for popup
  286. menus or other short parameter-setting windows).
  287.  
  288. [thanks to der Mouse (mouse@larry.mcrcim.mcgill.edu); 7/92]
  289.  
  290. ----------------------------------------------------------------------
  291. Subject: 147)  How do I make text and bitmaps blink in X?
  292.  
  293.     There is no easy way.  Unless you're willing to depend on some sort of
  294. extension (as yet non-existent), you have to arrange for the blinking yourself,
  295. either by redrawing the contents periodically or, if possible, by playing games
  296. with the colormap and changing the color of the contents.
  297.  
  298. [Thanks to mouse@larry.mcrcim.mcgill.edu (der Mouse), 7/91]
  299.  
  300. ----------------------------------------------------------------------
  301. Subject: 148)  How do I render rotated text?
  302.     
  303.     Xlib intentionally does not provide such sophisticated graphics
  304. capabilities, leaving them up to server-extensions or clients-side graphics
  305. libraries.
  306.     Your only choice, if you want to stay within the core X protocol, is to
  307. render the text into a pixmap, read it back via XGetImage(), rotate it "by
  308. hand" with whatever matrices you want, and put it back to the server via
  309. XPutImage(); more specifically:
  310.     1) create a bitmap B and write your text to it.
  311.     2) create an XYBitmap image I from B (via XGetImage).
  312.     3) create an XYBitmap Image I2 big enough to handle the transformation.
  313.     4) for each x,y in I2, I2(x,y) = I(a,b) where
  314.         a = x * cos(theta) - y * sin(theta)
  315.         b = x * sin(theta) + y * cos(theta)
  316.     5) render I2
  317.     Note that you should be careful how you implement this not to lose
  318. bits; an algorithm based on shear transformations may in fact be better.
  319.     The high-level server-extensions and graphics packages available for X
  320. also permit rendering of rotated text: Display PostScript, PEX, PHiGS, and GKS,
  321. although most are not capable of arbitrary rotation and probably do not use the
  322. same fonts that would be found on a printer.
  323.     In addition, if you have enough access to the server to install a font
  324. on it, you can create a font which consists of letters rotated at some
  325. predefined angle. Your application can then itself figure out placement of each
  326. glyph.
  327.  
  328. [courtesy der Mouse (mouse@larry.mcrcim.mcgill.edu), Eric Taylor
  329. (etaylor@wilkins.bmc.tmc.edu), and Ken Lee (klee@wsl.dec.com), 11/90;
  330. Liam Quin (lee@sq.com), 12/90]
  331.  
  332.     InterViews (C++ UI toolkit, in the X contrib software) has support for
  333. rendering rotated fonts in X.  It could be one source of example code.
  334. [Brian R. Smith (brsmith@cs.umn.edu), 3/91]
  335.     Another possibility is to use the Hershey Fonts; they are
  336. stroke-rendered and can be used by X by converting them into XDrawLine
  337. requests. [eric@pencom.com, 10/91]
  338.  
  339.     The xrotfont program by Alan Richardson (mppa3@syma.sussex.ac.uk)
  340. (posted to comp.sources.x July 14 1992) paints a rotated font by implementing
  341. the method above and by using an outline (Hershey) font.
  342.  
  343.     O'Reilly's X Resource Volume 3 includes information from HP about
  344. modifications to the X fonts server which provide for rotated and scaled text.
  345.  
  346. ----------------------------------------------------------------------
  347. Subject: 149)  What is the X Registry? (How do I reserve names?)
  348.  
  349.     There are places in the X Toolkit, in applications, and in the X
  350. protocol that define and use string names. The context is such that conflicts
  351. are possible if different components use the same name for different things.
  352.     The MIT X Consortium maintains a registry of names in these domains:
  353. orgainization names, selection names, selection targets, resource types,
  354. application classes, and class extension record types; and several others.
  355.     The list as of 7/91 is in the directory mit/doc/Registry on the R5
  356. tape; it is also available by sending "send docs registry" to the xstuff mail
  357. server.
  358.     To register names (first come, first served) or to ask questions send
  359. to xregistry@expo.lcs.mit.edu; be sure to include a postal address for
  360. confirmation.
  361.  
  362. [11/90; condensed from Asente/Swick Appendix H]
  363. ----------------------------------------------------------------------
  364.  
  365. David B. Lewis                     faq%craft@uunet.uu.net
  366.  
  367.         "Just the FAQs, ma'am." -- Joe Friday
  368. --
  369. David B. Lewis        Temporarily at but not speaking for Visual, Inc.
  370. day: dbl@visual.com    evening: david%craft@uunet.uu.net
  371. Xref: bloom-picayune.mit.edu comp.windows.x:62130 news.answers:4669
  372. Path: bloom-picayune.mit.edu!enterpoop.mit.edu!news.media.mit.edu!micro-heart-of-gold.mit.edu!news.bbn.com!olivea!sun-barr!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!yale!gumby!destroyer!cs.ubc.ca!alberta!art
  373. From: art@cs.UAlberta.CA (Art Mulder)
  374. Newsgroups: comp.windows.x,news.answers
  375. Subject: comp.windows.x: Getting more performance out of X.  FAQ
  376. Summary: This posting contains a list of suggestions about what you can do to get the best performance out of X on your workstation -- without buying more hardware.
  377. Keywords: FAQ speed X
  378. Message-ID: <art.724532420@warspite>
  379. Date: 16 Dec 92 19:00:20 GMT
  380. Sender: news@cs.UAlberta.CA (News Administrator)
  381. Reply-To: art@cs.ualberta.ca (Art Mulder)
  382. Followup-To: poster
  383. Organization: University of Alberta, Edmonton, Canada
  384. Lines: 556
  385. Approved: news-answers-request@MIT.Edu
  386. Nntp-Posting-Host: warspite.cs.ualberta.ca
  387.  
  388. Archive-name: x-faq/speedups
  389. Last-modified: 1992/12/16
  390.  
  391. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  392.  
  393.         HOW TO MAXIMIZE THE PERFORMANCE OF X -- monthly posting
  394.  
  395.   More RAM, Faster CPU's, More disk space, Faster Ethernet...  These are
  396.   the standard responses you get when you ask about how to make your
  397.   workstation go faster.
  398.  
  399.   Well, more hardware isn't always an option, and I wonder if more
  400.   hardware is really always even a necessity.
  401.  
  402.   This "FAQ" list is a collection of suggestions and ideas from different
  403.   people on the net on how you can the best possible performance from your
  404.   workstation, WITHOUT PURCHASING MORE HARDWARE.
  405.  
  406.   This document is specifically concerned with X.  I realize that there are
  407.   a whole host of other factors that affect the performance of a
  408.   workstation.   Perhaps at some point, this document will grow into a
  409.   generalized "System Performance Tuning" document, but for now our focus is
  410.   on X.
  411.     [ Note: People seriously interested in the whole area of system
  412.     performance, might want to look at the O'Reilly nutshell book
  413.     "System Performance Tuning" by Mike Loukides.  I've seen it,
  414.     but not read it, so I can't comment on its content.  --ed.]
  415.  
  416. -----------------
  417. Table of Contents
  418. -----------------
  419.   1. What about the "Other X FAQ"?
  420. ! 2. Window Managers
  421.   3. The X Server
  422.        Which Server?
  423.        Starting your Server
  424.        Fonts
  425. !      About the Resources File
  426.        Define Your Display Properly
  427. ! 4. Clients
  428. !      A Better Clock for X
  429.        A Better Terminal Emulator for X
  430.   5. Miscellaneous Suggestions
  431.        Pretty Pictures
  432.        A Quicker Mouse
  433.        Programming Thoughts
  434. !      Say What!?
  435.   6. Other Sources of Information
  436.   7. Author & Notes
  437.  
  438. -----------------------------
  439. What about the "Other X FAQ"?
  440. -----------------------------
  441.  
  442.   David B. Lewis (faq%craft@uunet.uu.net) maintains the informative and
  443.   well written "comp.windows.x Frequently Asked Questions" document.
  444.   Its focus though, is on generally useful X information, while this
  445.   FAQ is concerned with the issue of performance.
  446.  
  447.   The comp.windows.x FAQ does address the issue of speed, but only with
  448.   regards to the X server.  The gist of that topic seems to be:
  449.     "Use X11R5, it is faster than R4".
  450.   (Please see the X FAQ for complete details).
  451.  
  452.   Performance is a subjective issue.  The individual user must balance
  453.   `speed' versus `features' in order to come to a personal decision.
  454.   Therefore this document can be be expected to contain many subjective
  455.   opinions in and amongst the objective facts.
  456.  
  457. ---------------
  458. Window Managers
  459. ---------------
  460.  
  461.   There are a lot of window managers out there, with lots of different
  462.   features and abilities.  The choice of which to use is by necessity a
  463.   balancing act between performance and useful features.  At this
  464.   point, most respondents have agreed upon "twm" as the best candidate
  465.   for a speedy window manager.
  466.  
  467.   A couple of generic tricks you can try is turning off unnecessary
  468.   things like "zooming" and "opaque move".  Also, if you lay out your
  469.   windows in a tiled maner, you reduce the amount of cpu power spent
  470.   in raising and lowering windows.
  471.                     Joe English (joe@trystero.art.com)
  472.  
  473.   I've found that a good font for tiling is 7x13 (aka:
  474.   -misc-fixed-medium-r-normal--13-100-100-100-c-70-iso8859-1 ) It is
  475.   the biggest font I have found that I can use on a SPARC ELC and still
  476.   get two 80 column terminal windows side-by-side on the display with
  477.   no overlap.  Other suggestions will be accepted.
  478.  
  479. ------------
  480. The X Server
  481. ------------
  482.  
  483. Which Server?
  484. - - - - - - -
  485.  
  486.   Doesn't the old saying go: "Use the right tool for the job"?  This
  487.   applies to the X11 server also.  Make sure that your server is a
  488.   proper match for your hardware platform.  If you have a monochrome
  489.   monitor, use a monochrome X11 server.
  490.  
  491.   On my Monochrome Sun ELC, I haven't noticed much difference between
  492.   the Xsun (colour) server and XsunMono, however it was pointed out to
  493.   me that XsunMono is about 800k smaller and therefore should contribute
  494.   to less paging.
  495.          [ thanks to: Jonny Farringdon (j.farringdon@psychol.ucl.ac.uk),
  496.                         Michael Salmon (Michael.Salmon@eos.ericsson.se) ]
  497.  
  498.   How your server was compiled can also make a difference.  Jeff Law
  499.   (law@schirf.cs.utah.edu) advises us that on a Sun system, X should
  500.   be compiled with gcc2.* or with the unbundled Sun compiler, and *not*
  501.   use the the SunOS 4.1.1 bundled compiler.  You can expect to get
  502.   "*very* large speedups in the server" that way.  I would assume that
  503.   similar results would occur if you used one of the other popular
  504.   high-quality commercial compilers on the market.
  505.  
  506. Starting your Server
  507. - - - - - - - - - - -
  508.  
  509.   Joe English (joe@trystero.art.com) :
  510.     If you start up a lot of clients in your .xsession or whatever, sleep
  511.     for a second or two after launching each one.  After I changed my
  512.     .xclients script to do this, logging in actually took *less* time...
  513.     we have a heavily loaded system without much core, though.
  514.  
  515.   This sounds crazy, but I tried it, and it works!
  516.  
  517.   Warner Losh (imp@Solbourne.COM) provided me with a good explanation of
  518.   why this works, which I have summarized here:
  519.  
  520.     When you start up an X server it takes a huge amount of time to
  521.     start accepting connections.  A lot of initialization is done by
  522.     the server when it starts.  This process touches a large number of
  523.     pages.  Any other process running at the same time would fight the
  524.     server for use of the CPU, and more importantly, memory.  If you
  525.     put a sleep in there, you give the Server a chance to get itself
  526.     sorted out before the clients start up.
  527.  
  528.     Similarly, there is also a lot of initialization whenever an X
  529.     client program starts: toolkits registering widgets, resources
  530.     being fetched, programs initializing state and "databases" and so
  531.     forth.  All this activity is typically memory intensive.  Once this
  532.     initialization is done ("The process has reached a steady state"),
  533.     the memory usage typically settles down to using only a few pages.
  534.     So, by using sleeps to stagger the launching of your clients in
  535.     your .Xinitrc , you avoid them "fighting" each other over your
  536.     workstations limited resources
  537.  
  538.   This is most definitely a "Your Mileage May Vary" situation, as there
  539.   are so many variables to be considered: available RAM, local swap
  540.   space, load average, number of users on your system, which clients
  541.   you are starting, etc.
  542.  
  543.   Currently in my .xinitrc I have a situation like:
  544.     (sleep 1; exec xclock ) &
  545.     (sleep 1; exec xbiff ) &
  546.     (sleep 1; exec xterm ) &
  547.     (sleep 1; exec xterm ) &
  548.     (sleep 1; exec xterm ) &
  549.  
  550.   I've experimented with:
  551.     (sleep 1; exec xclock ) &
  552.     (sleep 2; exec xbiff ) &
  553.     (sleep 3; exec xterm ) &
  554.     (sleep 4; exec xterm ) &
  555.     (sleep 5; exec xterm ) &
  556.  
  557.   I've even tried:
  558.     (sleep 2; exec start_X_clients_script ) &
  559.   and then in start_X_clients_script I had:
  560.     (sleep 1; exec xclock ) &
  561.     (sleep 1; exec xbiff ) &
  562.     (sleep 1; exec xterm ) &
  563.     (sleep 1; exec xterm ) &
  564.     (sleep 1; exec xterm ) &
  565.  
  566.     [ The idea with this last one was to make sure that xinit had
  567.     completely finished processing my .xinitrc, and had settled down
  568.     into a "steady state" before the sleep expired and all my clients
  569.     were launched. ]
  570.  
  571.   All of these yielded fairly comparable results, and so I just stuck with
  572.   my current setup, for its simplicity.  You will probably have to
  573.   experiment a bit to find a setup which suits you.
  574.  
  575. Fonts
  576. - - -
  577.  
  578.   Loading fonts takes time, and RAM.  If you minimize the number of fonts
  579.   your applications use, you'll get speed increases in load-up time.
  580.  
  581.   Farrell McKay (fbm@ptcburp.ptcbu.oz.au) :
  582.     One small point I've noticed (not specifically related to R5) is that
  583.     clients will always start up more quickly if they don't have to load a
  584.     new font into the server.  So I only use two or three fonts throughout
  585.     the whole of my X environment.  Sometimes I need to use a Kanji font
  586.     (for my work) at intervals throughout the day, so in the morning I
  587.     start up xfd with that font (that loads it into the server), iconify
  588.     it, and leave it there for the rest of the day.  Pre-loaded fonts sure
  589.     cut down initialization time.
  590.  
  591.   Joe English (joe@trystero.art.com) :
  592.     Carefully choose a small number of fonts (one fixed-width, one roman,
  593.     one sans-serif, one large one, whatever else you need) and
  594.     reconfigure all the applications you use to use only those fonts.
  595.     This will conserve server resources and make applications start up
  596.     faster.  Loading fonts takes a long time.
  597.